package com.sinosoft.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Time;
import java.sql.Timestamp;

/**
 * @author loujiang
 * @date 2020/12/22 4:22 下午
 * @NOTE:
 */
@RestController
public class RetryController {


    @Value("${server.port}")
    String port;

    @GetMapping("/retry")
    public String Retry(@RequestParam int time) {
        System.out.println("请求进来了time:" + time + " " + port);
        while (time-- > 0) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {

            }
        }
        return "retry time is" + time + "-" + this.port;
    }

    @GetMapping("/retry1")
    public String Retry1(@RequestParam int time) {
        System.out.println("请求进来了time:" + time + " " + port);
        while (time-- > 0) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {

            }
        }
        return "retry time is" + time + "-" + this.port;
    }

}

